package cn.itlight.controller;


import cn.itlight.entity.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {

    //加载端口
    @Value("${server.port}")
    private int ip;

    @GetMapping(value = "/user/{id}" )
    public User getById(@PathVariable("id")Long id){

        return  new User(id,"zs:"+id,"我是zs,port:"+ip);	//端口随User返回
    }
}
